package easy

func FindMaxConsecutiveOnes(nums []int) int {
	curLen := 0
	maxLen := 0
	for _, num := range nums {
		if num == 1 {
			curLen++
		} else {
			curLen = 0
		}
		maxLen = max(curLen, maxLen)
	}
	return maxLen
}

func max(x, y int) int {
	if x > y {
		return x
	}
	return y
}
